package com.mediator.smartHouse;

/**
 * 抽象同事
 * 内部聚合了 中介 ，需要通过中介对象的getMessage方法向中介发消息
 */
public abstract class Colleague {

    private Mediator mediator;
    private String name;

    //构造
    public Colleague(Mediator mediator, String name) {
        this.mediator = mediator;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public Mediator getMediator() {
        return mediator;
    }

    //当同时的状态发生变化的时候发送消息给中介
    public abstract void sendMessage(int stateChange);
}
